﻿$(function(){//延迟加载	
	var dvfirmId='';
	$('#dvfirm').combobox({
		onChange:function(newValue,oldValue){
			if(newValue==''){				
				$('#dvbelong').combobox({					
					disabled:true
				});
				$('#dvbelong').combobox('clear');
				$('#dvmodel').combobox({
					disabled:true
				});
				$('#dvmodel').combobox('clear');
			}else{
				$('#dvmodel').combobox({
					disabled:true
				});
				dvfirmId=newValue;
				$('#dvbelong').combobox({
					value:'请选择',
					disabled:false,
					valueField: 'dvbelong',    
			        textField: 'devresname',
					url:"showdvbelongsec?dvfirmId="+dvfirmId,
				});
			}
		}
	});
	$('#dvmodel').combobox();
	$('#dvbelong').combobox({
		onChange:function(newValue,oldValue){
			if(newValue==''){				
				$('#dvmodel').combobox({
					disabled:true
				});
			}else{
				$('#dvmodel').combobox({
					value:'请选择',
					disabled:false,
					valueField:'dvmodelId',
					textField:'modelname',
					url:"showmodelsec?dvbelong="+newValue+"&dvfirmId="+dvfirmId,
				})
			}
		}
	});	
});